/*
  * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Database;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author owner
 */
public class Create_Konsumen {
    public static void main(String[] args) throws SQLException, FileNotFoundException, IOException {
        Connection con;
        con = Koneksi.open();
        Statement stat = con.createStatement();

        String buat = "CREATE TABLE KONSUMEN_T (ID_KONSUMEN VARCHAR2(4) CONSTRAINT k_id_pk PRIMARY KEY,"
                +"NAMA_PENGIRIM VARCHAR2(20),"
                +"ALAMAT_PENGIRIM VARCHAR2(50),"
                +"N0_TELEPON_PENGIRIM VARCHAR2(12),"
                +"NAMA_PENERIMA VARCHAR2(20),"
                +"ALAMAT_PENERIMA VARCHAR2(50),"
                +"NO_RESI VARCHAR2(16) CONSTRAINT k_no_fk REFERENCES BARANG_T(NO_RESI))";
        stat.executeQuery(buat);
        System.out.println("table KONSUMEN_T created");
    }
}
